package cn.sz.tm.util;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

import org.springframework.core.convert.converter.Converter;

public class MyDateConverter implements Converter<String, Date> {

	//String [][] arr = {{"\\d{4}-","yyyy-MM-dd HH:mm:ss"},{}}
	
	public Date convert(String source) {
		try {
			//source.matches(regex)
			System.out.println("1111111");
			SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
			return sdf.parse(source);
		} catch (ParseException e) {
			e.printStackTrace();
		}
		return null;
	}

}
